package com.hb.ssmdemo.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.hb.ssmdemo.persistence.entity.SysUser;
import com.hb.ssmdemo.service.SysUserService;

@Controller
@RequestMapping(value = "/console")
public class SysUserController {

	@Resource(name="sysUserService")
	private SysUserService sysUserService;

	@RequestMapping(value = "/getSysUser")
	public ModelAndView getSysUserByUserName(HttpServletRequest request, HttpServletResponse response) throws Exception {
		ModelAndView modelAndView = new ModelAndView("system/sysUser");
		String userName="admin";
		SysUser sysUser = sysUserService.getSysUser(userName);
		modelAndView.addObject("sysUser", sysUser);
		/***测试需要容器执行的程序-start***/
		//TestQuartz testQuartz = new TestQuartz();
		//testQuartz.test();
		/***测试需要容器执行的程序-end***/
		return modelAndView;
	}
}
